<? include("include/session.php"); ?>
<? 
    	$page="samenstellen2.php";
		mysql_connect ('localhost', 'deb46160', 'd3e01tGF') or die ('Error: ' .mysql_error());
		mysql_select_db ("deb46160_PizzaRio");
		$stamp = strtotime("now");
		$gem_pizzaID = $stamp-$REMOTE_ADDR;
		$gem_pizzaID = str_replace(".","", $gem_pizzaID);
		$_SESSION['gem_pizzaID']=$gem_pizzaID;
		date_default_timezone_set("Europe/Amsterdam");
		$user=$_SESSION['username'];
		$pizzanaam=$_POST['pizzanaam'];
		if (isset($_POST['verzenden']))
		{
			if (isset($_POST['ananas']))
			{
				$sql="INSERT INTO `Pizzaregel` VALUES(".$gem_pizzaID.", 1)";
				mysql_query($sql) or die(mysql_error());
			}
			if (isset($_POST['artisjokken']))
			{
				$sql="INSERT INTO `Pizzaregel` VALUES(".$gem_pizzaID.", 2)";
				mysql_query($sql) or die(mysql_error());
			}
			if (isset($_POST['broccolli']))
			{
				$sql="INSERT INTO `Pizzaregel` VALUES(".$gem_pizzaID.", 3)";
				mysql_query($sql) or die(mysql_error());
			}
			if (isset($_POST['champignons']))
			{
				$sql="INSERT INTO `Pizzaregel` VALUES(".$gem_pizzaID.", 4)";
				mysql_query($sql) or die(mysql_error());
			}
			if (isset($_POST['kappertjes']))
			{
				$sql="INSERT INTO `Pizzaregel` VALUES(".$gem_pizzaID.", 5)";
				mysql_query($sql) or die(mysql_error());
			}
			if (isset($_POST['mais']))
			{
				$sql="INSERT INTO `Pizzaregel` VALUES(".$gem_pizzaID.", 6)";
				mysql_query($sql) or die(mysql_error());
			}
			if (isset($_POST['olijven']))
			{
				$sql="INSERT INTO `Pizzaregel` VALUES(".$gem_pizzaID.", 7)";
				mysql_query($sql) or die(mysql_error());
			}
			if (isset($_POST['paprika']))
			{
				$sql="INSERT INTO `Pizzaregel` VALUES(".$gem_pizzaID.", 8)";
				mysql_query($sql) or die(mysql_error());
			}
			if (isset($_POST['rucola']))
			{
				$sql="INSERT INTO `Pizzaregel` VALUES(".$gem_pizzaID.", 9)";
				mysql_query($sql) or die(mysql_error());
			}
			if (isset($_POST['spaanse_peper']))
			{
				$sql="INSERT INTO `Pizzaregel` VALUES(".$gem_pizzaID.", 10)";
				mysql_query($sql) or die(mysql_error());
			}
			if (isset($_POST['spinazie']))
			{
				$sql="INSERT INTO `Pizzaregel` VALUES(".$gem_pizzaID.", 11)";
				mysql_query($sql) or die(mysql_error());
			}
			if (isset($_POST['tomaat']))
			{
				$sql="INSERT INTO `Pizzaregel` VALUES(".$gem_pizzaID.", 12)";
				mysql_query($sql) or die(mysql_error());
			}
			if (isset($_POST['uien']))
			{
				$sql="INSERT INTO `Pizzaregel` VALUES(".$gem_pizzaID.", 13)";
				mysql_query($sql) or die(mysql_error());
			}
			if (isset($_POST['Gorgonzola']))
			{
				$sql="INSERT INTO `Pizzaregel` VALUES(".$gem_pizzaID.", 14)";
				mysql_query($sql) or die(mysql_error());
			}
			if (isset($_POST['Mozzerella']))
			{
				$sql="INSERT INTO `Pizzaregel` VALUES(".$gem_pizzaID.", 15)";
				mysql_query($sql) or die(mysql_error());
			}
			if (isset($_POST['Ansjovis']))
			{
				$sql="INSERT INTO `Pizzaregel` VALUES(".$gem_pizzaID.", 16)";
				mysql_query($sql) or die(mysql_error());
			}
			if (isset($_POST['Bacon']))
			{
				$sql="INSERT INTO `Pizzaregel` VALUES(".$gem_pizzaID.", 17)";
				mysql_query($sql) or die(mysql_error());
			}
			if (isset($_POST['Ei']))
			{
				$sql="INSERT INTO `Pizzaregel` VALUES(".$gem_pizzaID.", 18)";
				mysql_query($sql) or die(mysql_error());
			}
			if (isset($_POST['Garnalen']))
			{
				$sql="INSERT INTO `Pizzaregel` VALUES(".$gem_pizzaID.", 19)";
				mysql_query($sql) or die(mysql_error());
			}
			if (isset($_POST['Gehakt']))
			{
				$sql="INSERT INTO `Pizzaregel` VALUES(".$gem_pizzaID.", 20)";
				mysql_query($sql) or die(mysql_error());
			}
			if (isset($_POST['Ham']))
			{
				$sql="INSERT INTO `Pizzaregel` VALUES(".$gem_pizzaID.", 21)";
				mysql_query($sql) or die(mysql_error());
			}
			if (isset($_POST['Kip']))
			{
				$sql="INSERT INTO `Pizzaregel` VALUES(".$gem_pizzaID.", 22)";
				mysql_query($sql) or die(mysql_error());
			}
			if (isset($_POST['Salami']))
			{
				$sql="INSERT INTO `Pizzaregel` VALUES(".$gem_pizzaID.", 23)";
				mysql_query($sql) or die(mysql_error());
			}
			if (isset($_POST['Shoarma']))
			{
				$sql="INSERT INTO `Pizzaregel` VALUES(".$gem_pizzaID.", 24)";
				mysql_query($sql) or die(mysql_error());
			}
			if (isset($_POST['Tonijn']))
			{
				$sql="INSERT INTO `Pizzaregel` VALUES(".$gem_pizzaID.", 25)";
				mysql_query($sql) or die(mysql_error());
			}
			if (isset($_POST['BBQsaus']))
			{
				$sql="INSERT INTO `Pizzaregel` VALUES(".$gem_pizzaID.", 26)";
				mysql_query($sql) or die(mysql_error());
			}
			if (isset($_POST['Bolognese']))
			{
				$sql="INSERT INTO `Pizzaregel` VALUES(".$gem_pizzaID.", 27)";
				mysql_query($sql) or die(mysql_error());
			}
			if (isset($_POST['Extra_tomatensaus']))
			{
				$sql="INSERT INTO `Pizzaregel` VALUES(".$gem_pizzaID.", 28)";
				mysql_query($sql) or die(mysql_error());
			}
			if (isset($_POST['Knoflook']))
			{
				$sql="INSERT INTO `Pizzaregel` VALUES(".$gem_pizzaID.", 29)";
				mysql_query($sql) or die(mysql_error());
			}
			if (isset($_POST['Pesto']))
			{
				$sql="INSERT INTO `Pizzaregel` VALUES(".$gem_pizzaID.", 30)";
				mysql_query($sql) or die(mysql_error());
			}
			
		}
		$query="INSERT INTO `gem_pizzas`(`gem_pizzaID`, `userid`, `datum`, `pizzanaam`) VALUES (".$gem_pizzaID.",'".$user."',CURDATE(),'$pizzanaam')";	
		mysql_query($query) or die(mysql_error());
		header("Refresh: 1; URL=\"" . $page . "\"");
	?>
